package com.answeringplayer.exception;

import lombok.Getter;

/**
 * 业务异常
 */
@Getter
public class BusinessException extends BaseException {

    public BusinessException(String message) {
        super(400, message);
    }

    public BusinessException(Integer code, String message) {
        super(code, message);
    }

    public BusinessException(String message, Throwable cause) {
        super(400, message, cause);
    }

    // 快速创建业务异常的静态方法
    public static BusinessException of(String message) {
        return new BusinessException(message);
    }

    public static BusinessException of(Integer code, String message) {
        return new BusinessException(code, message);
    }
}